package cn.netbox.spring.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * description:
 * date: 2021/11/27 19:26
 * author: Alex
 * version: 1.0
 */
//@Component
//@Component(value = "myStudent")
@Component("zlqStudent")
public class ZLQStudent extends Student{

    @Value("${tomName}")
    private String name;


    @Value("${tomId}")
    private int id;

    @Autowired(required = false)
    @Qualifier("zlqSchool")
    private ZLQSchool school;

    @Resource(name = "zlqHome")
    private ZLQHome home;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", school=" + school +
                ", home=" + home +
                '}';
    }
}
